package com.zxd.mylambda;

import com.zxd.clones.Students;

import java.util.*;
import java.util.function.ToIntFunction;

/**
 * ClassName:Test
 * Package:com.zxd.mylambda
 *
 * @Date:2023/9/23 10:54
 * @Author:zxde
 */
//测试匿名内部类
public class Test {
    public static void main(String[] args) {
        Students student1 = new Students("zxde",9,new Double[]{1.0});
        Students student2 = new Students("zxde",12,new Double[]{1.0});
        Students student3 = new Students("zxde",11,new Double[]{1.0});
        Students student4 = new Students("zxde",4,new Double[]{1.0});
        Students student5 = new Students("zxde",19,new Double[]{1.0});
        Set<Students> set = new TreeSet<>(Comparator.comparingInt(Students::getAge));
        set.add(student1);
        set.add(student2);
        set.add(student3);
        set.add(student4);
        set.add(student5);
        set.forEach(System.out::println);
    }
}
